home *** CD-ROM | disk | FTP | other *** search
- ; simple system report program :
-
- ; could be useful to include in archives, and have
- ; your users give an accurate description of their
- ; system...best if packed with StoneCracker though :)
-
- ; jamesboyd@all-hail.freeserve.co.uk
-
- WBStartup
-
- ; size-saving version of "Lisa" command, but can't use in a function :(
- MOVE.w $dff07c,d0
- PutReg d0,chip.w ; "chip" variable is Shared in ChipSet {} function
-
- Function$ LoadScreenFont {f.w}
-
- *scr.Screen=Peek.l(Addr Screen(Used Screen))
- If *scr=0 Then Function Return ""
-
- *scfont.TextAttr=*scr.Screen\Font
- If *scfont=0 Then Function Return ""
-
- ; In AmigaDOS we trust :
- fheight.b=*scfont.TextAttr\ta_YSize
- fname$=Peek$(*scfont.TextAttr\ta_Name)
-
- LoadFont f,fname$,fheight:Function Return Str$(f)+":"+fname$+":"+Str$(fheight)
- End Function
-
- ; 0 = 68000
- ; 1 = 68010
- ; 2 = 68020
- ; 3 = 68030
- ; 4 = 68040 ; note - no 5! ;)
- ; 6 = 68060
-
- Function.b GetCPU {}
-
- cpu.b=0
- *e.ExecBase = Peek.l(4)
-
- #AFF_68060=(1 LSL 7) ; flag for 060, not in Blitz includes
-
- If *e
-
- If *e\AttnFlags & #AFF_68010 ; gotta do it like this,
- If *e\AttnFlags & #AFF_68020 ; cos each processor has the
- If *e\AttnFlags & #AFF_68030 ; flags of the previous processor
- If *e\AttnFlags & #AFF_68040 ; set, too...
- If *e\AttnFlags & #AFF_68060
- cpu=6
- Else cpu=4
- EndIf
- Else cpu=3
- EndIf
- Else cpu=2
- EndIf
- Else cpu=1
- EndIf
- Else cpu=0
- EndIf
-
- EndIf
-
- Function Return cpu
- End Function
-
- ; 0 = No FPU
- ; 1 = 68881 FPU
- ; 2 = 68882 FPU
- ; 3 = 68040 FPU (no math emulation) ; 040.library not loaded
- ; 4 = 68040 FPU (math emulation)
- ; 5 = 68060 FPU (no math emulation) ; 060.library not loaded
- ; 6 = 68060 FPU (math emulation)
-
- Function.b GetFPU {}
-
- fpu.b=0
- *e.ExecBase = Peek.l(4)
-
- #AFF_68060=(1 LSL 7)
-
- If *e
-
- If *e\AttnFlags & #AFF_68881
- If *e\AttnFlags & #AFF_68882
- fpu=2
- Else fpu=1
- EndIf
-
- If *e\AttnFlags & #AFF_FPU40
- fpu=4 ; 68040 FPU (math emulation)
- If *e\AttnFlags & #AFF_68060 ; check for 060...
- fpu=6 ; 68060 FPU (math emulation)
- EndIf
- EndIf
-
- Else fpu=0 ; No 68881 or 68882
-
- If *e\AttnFlags & #AFF_FPU40 ; check if it's an 040 without 6888x emulation...
- fpu=3 ; 68040 FPU (no math emulation)
- If *e\AttnFlags & #AFF_68060 ; check for 060...
- fpu=5 ; 68060 FPU (no math emulation)
- EndIf
- EndIf
-
- EndIf
-
- EndIf
-
- Function Return fpu
- End Function
-
- Function.w KickVersion {}
- e$="exec.library"
- *lib.Library=OpenLibrary_(&e$,33)
-
- If *lib
- v.w=*lib\lib_Version
- CloseLibrary_ *lib
- EndIf
- Function Return v
- End Function
-
- Function.w WBColours {}
- Function Return 2^WBDepth
- End Function
-
- Function.s ChipSet {}
-
- SHARED chip
-
- Select chip
- Case $00
- chip$="OCS"
- Case $F7
- chip$="ECS"
- Case $F8
- chip$="AGA"
- Case $F9
- chip$="AA (Prototype)"
- Default
- chip$="unknown"
- End Select
-
- Function Return chip$
- End Function
-
- FindScreen 0,"Workbench Screen"
-
- a$=LoadScreenFont{0}
- a$=Replace$("Workbench font : "+Right$(a$,Len(a$)-Instr(a$,":"))+"|",".font","")
-
- a$+"CPU : 680"+Str$(GetCPU{})+"0|"
-
- a$+"FPU : "
-
- a.b=GetFPU{}
-
- Select a
- Case 0
- a$+"No FPU"
- Case 1
- a$+"68881 FPU"
- Case 2
- a$+"68882 FPU"
- Case 3
- a$+"68040 FPU (no math emulation)"
- Case 4
- a$+"68040 FPU (math emulation)"
- Case 5
- a$+"68060 FPU (no math emulation)"
- Case 6
- a$+"68060 FPU (math emulation)"
- End Select
-
- a$+"|"
-
- a$+"Kickstart : "+Str$(KickVersion{})+"|"
-
- a$+"Workbench colours : "+Str$(WBColours{})+"|"
-
- a$+"Chipset : "+ChipSet{}
-
- If Request ("SysRep","System Analysis :||"+a$,"Create report|End")
-
- If WriteFile (0,"RAM:SysRep.txt")
- a$=Replace$(a$,"|",Chr$(10))
- FileOutput 0
- NPrint a$
- CloseFile 0:PopOutput
- Request "","Created report as RAM:SysRep.txt","OK"
- Else Request "","Couldn't generate RAM:SysRep.txt","Doh!"
- EndIf
-
- EndIf
-
- End
-
-